package com.atgugui.springcloud.service;

import com.atguigu.springcloud.entities.CommonResult;
import com.atguigu.springcloud.entities.Payment;
import feign.Param;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * Created with IntelliJ IDEA.
 * ClassName: PaymentFeignService
 * Package: com.atgugui.springcloud.service
 * Description:
 * User: fzykd
 *
 * @Author: LQH
 * Date: 2023-11-04
 * Time: 22:16
 */

@Component
@FeignClient(value = "CLOUD-PAYMENT-SERVICE")
//就是找微服务的模块名称
public interface PaymentFeignService {


    //调用的接口实际就是业务的接口
    //去找到这个微服务下面的这个地址
    @GetMapping("/payment/get/{id}")
    CommonResult<Payment> getPayment(@PathVariable("id") Long id);

    @GetMapping(value = "/payment/feign/timeout")
    public String paymentFeignTimeout();

}
